import Vue from 'vue'
import Vuex from 'vuex'
import app from './modules/app'
import permission from './modules/permission'
import user from './modules/user'
import tagsView from './modules/tagsView'
// import websocket from './modules/websocket'

import getters from './getters'

Vue.use(Vuex)

const store = new Vuex.Store({
  modules: {
    app,
    permission,
    user,
    tagsView

    // websocket
  },
  getters
})

// store.watch(
//   (state) => state.isOpen,
//   (val) => {
//     if (val === false) {
//       console.log('重试中')
//       store.commit('setToken')
//       store.commit('init')
//     }
//   }
// )

export default store
